package com.sena.crawler.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author seven
 * @create 2021-06-24 12:19
 **/
public enum UrlTypeEnums {

    URL("URL", "普通url"),
    
    URL_PDF("URL_PDF", "pdf文件"),

    URL_XLS("URL_XLS", "Excel 2003 "),

    URL_XLSX("URL_XLSX", "Excel 2010 "),

    URL_TEXT("URL_TEXT", "txt文件"),

    URL_DOC("URL_DOC", "2003world"),

    URL_DOCX("URL_DOCX", "2010world"),

    URL_OTHER("URL_OTHER", "外站url"),

    URL_FILE("URL_FILE", "文件连接"),
    ;

    public static UrlTypeEnums getByCodeType(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }

        for (UrlTypeEnums result : values()) {
            if (code.equalsIgnoreCase(result.getCode())) {
                return result;
            }
        }

        return null;
    }


    UrlTypeEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * codeType
     */
    private String code = null;

    /**
     * 描述
     */
    private String desc = null;


}
